#ifndef DATABASE_H
#define DATABASE_H

#define MAGIC_NUMBER    ".BOOKDB."
#define MAX_DBNAME_LEN  30
#define DEFAULT_DIR     "DBfile"

#include "table.h"

typedef struct Database {
    table_t *user;
    table_t *book;
    table_t *borrow;
    char dbname[MAX_DBNAME_LEN];
} db_t;

db_t *createDB();
void destroyDB(db_t *db);
int flushToDisk(db_t *db, const char *filename);
int loadFromDisk(db_t *db, const char *filename);

#endif  /* DATABASE_H */